using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sec_scan漏洞扫描系统
{
    public partial class Sec_Scan_SystemSet : Form
    {
        public Sec_Scan_SystemSet()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 隐藏或设置窗体，应用于选项卡
        /// </summary>
        /// <param name="subForm"></param>
        private void OpenForm(Form subForm)
        {
            foreach (Control item in this.panel2.Controls)
            {
                if (item is Form)
                {
                    ((Form)item).Close();
                }
            }
            subForm.TopLevel = false;// 将子窗体设置为非顶级控件
            subForm.FormBorderStyle = FormBorderStyle.None;//设置无边框
            subForm.Parent = this.panel2;//设置窗体容器
            subForm.Dock = DockStyle.Fill; //容器大小随着调整窗体大小自动变化
            subForm.Show();
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            OpenForm(new Sec_Scan_PassWord());
            ReferBackColor();
            linkLabel1.LinkColor = Color.Lime;//默认加载颜色为绿色
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            OpenForm(new Sec_Scan_Agent());
            ReferBackColor();
            linkLabel2.LinkColor = Color.Lime;//默认加载颜色为绿色
        }

        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            OpenForm(new Sec_Scan_Port());
            ReferBackColor();
            linkLabel3.LinkColor = Color.Lime;//默认加载颜色为绿色
        }

        private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //扫描设置
            OpenForm(new Sec_ScanSystem());
            ReferBackColor();
            linkLabel4.LinkColor = Color.Lime;//默认加载颜色为绿色
        }

        private void SystemSet_Load(object sender, EventArgs e)
        {
            //默认加载系统密码界面
            OpenForm(new Sec_Scan_PassWord());
            linkLabel1.LinkColor = Color.Lime;//默认加载颜色为绿色
        }
        /// <summary>
        /// 刷新背景颜色
        /// </summary>
        public void ReferBackColor()
        {
            linkLabel1.LinkColor = Color.White;
            linkLabel2.LinkColor = Color.White;
            linkLabel3.LinkColor = Color.White;
            linkLabel4.LinkColor = Color.White;
            linkLabel5.LinkColor = Color.White;
        }

        private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //指纹识别
            OpenForm(new Sec_Scan_Finge());
            ReferBackColor();
            linkLabel5.LinkColor = Color.Lime;//默认加载颜色为绿色
        }
    }
}
